$table-graph-cell: $g0-obsidian;
$table-graph-cell--highlight: $g2-kevlar;
$table-graph-heading-bg: $g1-raven;
$table-graph-heading-bg--active: $g3-castle;
$table-graph-border: $g3-castle;
$table-graph-font: 12px;

.time-machine-tables {
  display: flex;
  align-items: stretch;
  flex-wrap: nowrap;
  width: 100%;
  height: 100%;
}

.time-machine-sidebar {
  flex: 1 0 180px;
  background-color: $g0-obsidian;
  margin-right: $ix-marg-a;
  overflow: hidden;
  border-radius: $ix-radius;
  border: $ix-border solid $g3-castle;
}

.time-machine-sidebar--heading {
  padding: 10px;
  background: $g3-castle;
  height: 50px;
}

.time-machine-sidebar--scroll {
  height: calc(100% - 50px) !important;
}

.time-machines-sidebar--filter.form-control.cf-input-xs {
  font-size: 12px;
}

.time-machine-sidebar--items {
  display: inline-flex;
  flex-direction: column;
}

.time-machine-sidebar-item {
  @include no-user-select();
  color: $g11-sidewalk;
  font-size: $table-graph-font;
  font-weight: 600;
  padding: 6px 12px;
  transition: color 0.25s ease, background-color 0.25s ease;
  white-space: nowrap;

  > span {
    padding-right: 1px;
    padding-left: 1px;
  }

  > span.key {
    color: $g9-mountain;
  }

  > span.value {
    padding-right: 5px;
    color: $g11-sidewalk;
  }

  &:hover {
    background-color: $g2-kevlar;
    color: $g13-mist;
    cursor: pointer;

    > span.key {
      color: $g13-mist;
    }

    > span.value {
      color: $g20-white;
    }
  }
  
  &.active {
    background-color: $g3-castle;
    color: $g18-cloud;

    > span.key {
      color: $g18-cloud;
    }

    > span.value {
      color: $c-pool;
    }
  }
}

.time-machine-table {
  flex: 4 0 100px;
  border: $ix-border solid $table-graph-border;
  border-radius: $ix-radius-sm;
  overflow: hidden;

  &:only-child {
    border: 1;
  }
}

/*
    Table Type Graphs in Dashboards
    ----------------------------------------------------------------------------
*/

.table-graph-cell {
  user-select: text !important;
  -o-user-select: text !important;
  -moz-user-select: text !important;
  -webkit-user-select: text !important;
  line-height: 28px; // Cell height - 2x border width
  padding: 0 6px;
  font-size: $table-graph-font;
  background-color: $table-graph-cell;
  font-weight: 500;
  color: $g11-sidewalk;
  border: ($ix-border / 2) solid $table-graph-border;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  &__highlight-row {
    color: $g20-white;
    background-color: $table-graph-cell--highlight;
  }
  &__numerical {
    font-family: $code-font;
    text-align: right;
  }
  &__fixed-row,
  &__fixed-column {
    font-weight: 700;
    color: $g14-chromium;
    background-color: $table-graph-heading-bg;
  }
  &__fixed-row {
    border-top: 0;
  }
  &__fixed-column {
    border-left: 0;
  }
  &__fixed-corner {
    font-weight: 700;
    border-top: 0;
    border-left: 0;
    color: $g18-cloud;
    background-color: $table-graph-heading-bg--active;
  }
  &__field-name {
    padding-right: 17px;

    &:before {
      font-family: 'icomoon';
      content: '\e902';
      font-size: 17px;
      position: absolute;
      top: 50%;
      right: 6px;
      transform: translateY(-50%) rotate(180deg);
      font-size: 13px;
      opacity: 0;
      transition: opacity 0.25s ease, color 0.25s ease, transform 0.25s ease;
    }
    &:hover {
      cursor: pointer;
    }
    &:hover:before {
      opacity: 1;
    }
  }
  &__sort-asc,
  &__sort-desc {
    color: $c-pool;

    &:before {
      opacity: 1;
    }
  }
  &__sort-asc:before {
    transform: translateY(-50%) rotate(180deg);
  }
  &__sort-desc:before {
    transform: translateY(-50%) rotate(0deg);
  }
}

.ReactVirtualized__Grid {
  &:focus {
    outline: none;
  }
  &::-webkit-scrollbar {
    width: 0px;
    height: 0px;
  }
  &.table-graph--scroll-window {
    &::-webkit-scrollbar {
      width: 10px;
      height: 10px;

      &-button {
        background-color: $g5-pepper;
      }
      &-track {
        background-color: $g5-pepper;
      }
      &-track-piece {
        background-color: $g5-pepper;
        border: 2px solid $g5-pepper;
        border-radius: 5px;
      }
      &-thumb {
        background-color: $g11-sidewalk;
        border: 2px solid $g5-pepper;
        border-radius: 5px;
      }
      &-corner {
        background-color: $g5-pepper;
      }
    }
    &::-webkit-resizer {
      background-color: $g5-pepper;
    }
  }
}
